import store from '@/store'
export default function checkPermission(value) {
  const roleCodes = store.getters.roleCodes
  if (!value || value.length === 0 || !(value instanceof Array)) {
    console.error(`权限指令参数有误`)
    return false
  }
  const hasPermission = roleCodes.some(role => {
    return value.includes(role)
  })
  if (!hasPermission) {
    return false
  }
  return true
}
